package com.example.demo1.pay.service.impl;

import com.example.demo1.pay.entity.FundIntercourse;
import com.example.demo1.pay.mapper.FundIntercourseMapper;
import com.example.demo1.pay.service.FundIntercourseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * <p>
 * 用户资金往来表 服务实现类
 * </p>
 *
 * @author gong
 * @since 2023-02-27
 */
@Service
public class FundIntercourseServiceImpl extends ServiceImpl<FundIntercourseMapper, FundIntercourse> implements FundIntercourseService {

    @Override
    public void setFundIntercourse(String payerWalletId, String payeeWalletId, BigDecimal amount, String outIn, String businessType, String serialNu) {
        FundIntercourse fundIntercourse = new FundIntercourse();
        fundIntercourse.setWalletId(Long.valueOf(payerWalletId));
        fundIntercourse.setOppositeRefId(Long.valueOf(payeeWalletId));
        fundIntercourse.setAmount(amount);
        fundIntercourse.setType(outIn);
        fundIntercourse.setBusinessType(businessType);
        fundIntercourse.setSerialNumber(serialNu);
        this.baseMapper.insert(fundIntercourse);
    }
}
